import request from '@/router/axios';
import {exportFunc} from '@/api/export.js'


//列表
export const equipmentList = (current, size, mold) => {
  return request({
    url: '/api/hg-public/produceequipment/page',
    method: 'get',
    params: {
      current,
      size,
      ...mold
    }
  })
}
//添加
export const equipmentAdd = (mold) => {
  return request({
    url: '/api/hg-public/produceequipment/save',
    method: 'post',
    data: mold
  })
}

//编辑时获取数据
export const equipmentDetail = (id) => {
  return request({
    url: '/api/hg-public/produceequipment/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//编辑
export const equipmentUpdate = (mold) => {
  return request({
    url: '/api/hg-public/produceequipment/update',
    method: 'post',
    data: mold
  })
}

//删除
export const removeequipment = (mold) => {
  return request({
    url: '/api/hg-public/produceequipment/remove',
    method: 'post',
    data: mold
  })
}

// 下载模板
export const downloadManualFile = (headers,name) => {
  exportFunc('/hg-public/equipmentinfo/downloadManualFile', headers, '', name)
}

// 导出设备信息
export const exportEquipment = (headers,params,name) => {
  exportFunc('/hg-public/equipmentinfo/exportEquipment', headers, params, name)
}
